import { Body, Controller, Get, Post } from '@nestjs/common';
import { ApiResponse, ApiTags } from '@nestjs/swagger';
import { SiteService } from './site.service';
import { SiteDataVO } from './vo/site-data.vo';
import { SiteAddDTO } from './dto/site-add.dto';

@ApiTags('站点记录')
@Controller('site')
export class SiteController {
  constructor(private readonly siteService: SiteService) {}

  @Get('query')
  @ApiResponse({ description: '查询数据返回', type: [SiteDataVO] })
  async query() {
    return this.siteService.querySiteListService();
  }

  @Post('add')
  @ApiResponse({ description: '添加' })
  async add(@Body() siteAddDTO: SiteAddDTO) {
    return this.siteService.addSiteService(siteAddDTO);
  }
}
